package com.kristin.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author Kristin
 * @Date 2021/05/06 11:00:55
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/remote")
public class DemoController {


    @RequestMapping("/getDemo")
    public String getUser() {
        RestTemplate restTemplate = new RestTemplate();
        ResponseEntity<String> result = restTemplate.getForEntity("http://SERVER-SERVICE/demo/getDemo", String.class);
        String body = result.getBody();
        System.out.println(body);
        return body;
    }


}
